import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dialog-对话框',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Dialog-对话框'),
        ),
        body: DemoPage(),
      ),
    );
  }
}

class DemoPage extends StatefulWidget{
  @override
  DemoPageState createState() => DemoPageState();
}

class DemoPageState extends State{

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        RaisedButton(onPressed: (){},
          color: Colors.red,
          child: Text('red'),
        ),
        //填充完
        Expanded(child: RaisedButton(onPressed: (){},
    color: Colors.grey,
    child: Text('grey'),
    ),),
        //不填充完
        Flexible(child:         RaisedButton(onPressed: (){},
          color: Colors.orange,
          child: Text('orange'),
        ),),
        RaisedButton(onPressed: (){},
        color: Colors.yellow,
          child: Text('yellow'),
        ),
        Row(
          children: [
            RaisedButton(onPressed: (){},
              color: Colors.red,
              child: Text('red'),
            ),
            //填充完
            Expanded(child: RaisedButton(onPressed: (){},
              color: Colors.grey,
              child: Text('grey'),
            ),),
            //不填充完
            // Flexible(child:         RaisedButton(onPressed: (){},
            //   color: Colors.orange,
            //   child: Text('orange'),
            // ),),
            RaisedButton(onPressed: (){},
              color: Colors.yellow,
              child: Text('yellow'),
            ),
          ],
        )
      ],
    );
  }
}